
#include <iostream>
#include <fstream>
#include "sqlist.h"

using namespace std;

typedef int elemtype;
typedef sqlisttpl<elemtype> sqlist;

void invert( sqlist & );

int main()
{
    ifstream in( "in.txt" );
    vector<elemtype> v;
    sqlist s;
    int i, n;
    int t;

    in >> n;
    for ( i = 0; i < n; i++ ){
	in >> t;
	v.push_back(t);
    }

    s.create( v );
    s.print(); cout << endl;
    invert( s );
    s.print(); cout << endl;

    return 0;
}


/* ******************************************************
 *             Answer to this question.
 * ******************************************************/

void invert( sqlist &s )
{
    int i, j;
    elemtype t;
    
    i = 0;
    j = s.length() - 1;
    while( i < j ){
        t = s[i];
        s[i] = s[j];
        s[j] = t;
        i++, j--;
    }
    
    return;
}
